<?php
/**
 * --------------------------------------------------------------------
 * 会员模型
 * --------------------------------------------------------------------
 * @author Midnight, yangyunzhou@foxmail.com
 * --------------------------------------------------------------------
 * @copyright Midnight Studio
 * --------------------------------------------------------------------
 */
class MemberModel extends RbacModel {

	/**
	 * 主键
	 * @var String
	 */
	public $pk = 'id';

	/**
	 * 字段
	 * @var Array
	 */
	public $fields = array('id','name','password','email','nickname','role','sex','regip','regdate','lastip','lastdate','state');

    /**
     * 表单验证
     * @var Array
     */
    public $_validate = array(
        array('name', 'require', '用户名不能为空！'),
        array('password', 'require', '密码不能为空！'),
        array('name', '', '用户名已存在!', 0, 'unique', 1),
        array('email', "/^[a-z]([a-z0-9]*[-_\.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[\.][a-z]{2,3}([\.][a-z]{2})?$/i", '邮箱格式不正确!'),
    );
}